import {
    get,
    post,
    DELETE
} from '@/utils/axios.js'
var wsApi = '/ws/v1'

// 查询tab状态列表
// 待查询类型 3-公示 4-部门 5-乡镇 6-开工 7-施工 8-竣工
export function queryTabList(params) {
    return get(wsApi + '/buildApplyBase/getByStatusList', params)
}

// ==============================================  审查公示  ==============================================
// 获取公示列表
export function getNoticeList(data) {
    return get(wsApi + '/bulidCaseHandler/government/affairs/page', data)
}

// 获取公示详情
export function getNoticeDetail(id) {
    return get(wsApi + `/bulidCaseHandler/village/${id}`)
}

// 生成公示文件
export function exportPublicWord(data) {
    return post(wsApi + `/bulidCaseHandler/exportPublicWord`, data)
}

// 公示结束办理保存
export function savePublicVillage(data) {
    return post(wsApi + `/bulidCaseHandler/village/public/save`, data)
}

// 获取审查详情
export function getVillageDetail(id) {
    return get(wsApi + `/bulidCaseHandler/village/review/${id}`)
}

// 审查保存
export function saveVillageReview(data) {
    return post(wsApi + `/bulidCaseHandler/village/review/save`, data)
}

// ==============================================  审查项  ==============================================

// 获取审查项
export function reviewOptionsApi(params) {
    return get(wsApi + `/reviewItems/list`, params)
}

// 获取审查项详情
export function reviewItemsDetail(id) {
    return get(wsApi + `/reviewItems/${id}`)
}

// 审查项删除
export function deleteReviewItems(id) {
    return DELETE(wsApi + `/reviewItems/${id}`)
}

// 保存审查项
export function saveReviewItems(data) {
    return post(wsApi + `/reviewItems/save`, data)
}

// 审查项更新
export function updateReviewItems(data) {
    return post(wsApi + `/reviewItems/update`, data)
}

// ==============================================  部门审批  ==============================================
// 获取部门审批列表
export function getBulidDeptList(data) {
    return get(wsApi + '/bulidDeptHandler/page', data)
}

// 获取部门审批详情
export function getBulidDeptDetail(params) {
    return get(wsApi + `/bulidDeptHandler/review`, params)
}

// 部门审批保存
export function saveBulidDept(data) {
    return post(wsApi + `/bulidDeptHandler/dept/reviewSave`, data)
}

// ==============================================  乡镇联审  ==============================================
// 获取乡镇联审列表
export function getJointReviewList(data) {
    return get(wsApi + '/jointReviewOpinions/page', data)
}

// 获取乡镇联审详情
export function jointReviewDetail(id) {
    return get(wsApi + `/jointReviewOpinions/selectInfoForVillageAudit/${id}`)
}

// 乡镇联审保存
export function saveJointReview(data) {
    return post(wsApi + `/jointReviewOpinions/saveOrAudit`, data)
}

// 农村宅基地批准书
export function exportVillageRatificationWord(data) {
    return post(wsApi + `/jointReviewOpinions/exportVillageRatificationWord`, data)
}

// 乡村建设规划许可证
export function exportVillageLicenceWord(data) {
    return post(wsApi + `/jointReviewOpinions/exportVillageLicenceWord`, data)
}

// 乡镇联审反馈详情
export function jointReviewFeedbackDetail(params) {
    return get(wsApi + `/jointReviewOpinions/reviewItemsDetail`, params)
}


// ==============================================  竣工审批  ==============================================
// 获取竣工审批列表
export function getCompletedList(data) {
    return get(wsApi + '/buildCompletedOpinions/completed/page', data)
}

// 获取竣工审批详情
export function getCompletedDetail(id) {
    return get(wsApi + `/buildCompletedOpinions/select/completed/${id}`)
}

// 竣工审批保存
export function saveCompleted(data) {
    return post(wsApi + `/buildCompletedOpinions/save`, data)
}